package _220330;

import java.util.Scanner;

/**
 * @author ShadowLim
 * @create 2022-03-30-11:35
 */
public class 第二点五个不高兴的小明 {
    static int n, p, t;
    static int[] a;
    static int[][] dp;  // dp[i][j]表示第i次跳跃到第j格的最大权值之和
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        n = scanner.nextInt();
        p = scanner.nextInt();
        t = scanner.nextInt();
        a = new int[n + 2];
        dp = new int[t + 2][n + 2];
        for (int i = 1; i <= n; i++) {
            a[i] = scanner.nextInt();
        }
        for (int i = 1; i <= t; i++) {
            for (int j = 0; j <= n; j++) {
                dp[i][j] = Integer.MIN_VALUE;
            }
        }
        for (int i = 1; i <= p && i <= n; i++) {
            dp[1][i] = a[i];
        }
        dp[0][0] = 0;
        int step = 2;
        while (step < t) {
            for (int idx = step - 1; idx <= n; idx++) {
                if (dp[step - 1][idx] == Integer.MIN_VALUE) {
                    continue;
                }
                for (int i = 1; i <= p; i++) {
                    int newIdx = idx + i;
                    if (newIdx > n + 1) {
                        continue;
                    }
                    int temp = dp[step - 1][idx] + a[newIdx];
                    dp[step][newIdx] = Math.max(dp[step][newIdx], temp);
                }
            }
            step++;
        }
        int maxN = Integer.MIN_VALUE;
        for (int i = 1; i <= n; i++) {
            if (dp[t - 1][i] > maxN && i + p >= n + 1) {
                maxN = dp[t - 1][i];
            }
        }
        System.out.println(maxN);
    }
}
